<template>
  <div>
    <header>
      <div>我是通用header</div>
      <router-link :to="{ name: 'userList' }">跳转到列表</router-link>
      <div></div>
      <router-link to="/user/detail">跳转到详情</router-link>
      <div @click="goList">通过router 跳转到列表</div>
      <div @click="goDetail">通过router跳转的到详情</div>
    </header>
    <router-view></router-view>
  </div>
</template>
<script setup>
import { useRouter } from "vue-router";
const router = useRouter();
const goList = () => {
  router.push({ name: "userList" });
};
const goDetail = () => {
  router.push({ name: "userDetail" });
};
</script>
<style></style>
